package com.bobi.tfca.model.entity;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bobi.tfca.model.vo.ArticleVO;
import com.bobi.tfca.model.vo.MemberVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.util.Date;

/**
 * 会员实体
 * @author 李文发
 * @date 2024/4/2
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "member")
public class MemberEntity {

    // 会员id
    @TableId
    @ApiModelProperty(value = "会员id")
    private Integer memberId;
    @ApiModelProperty(value = "会员姓名")
    // 会员姓名
    private String memberName;
    @ApiModelProperty(value = "出生日期")
    // 出生日期
    private LocalDate birthday;
    @ApiModelProperty(value = "性别")
    // 性别
    private String sex;
    @ApiModelProperty(value = "联系电话")
    // 联系电话
    private String telephone;
    @ApiModelProperty(value = "电子邮箱")
    // 电子邮箱
    private String email;
    @ApiModelProperty(value = "密码")
    // 密码
    private String password;
    @ApiModelProperty(value = "在会状态（0：审核，1：在会，2：退会）")
    // 在会状态（0：审核，1：在会，2：退会）
    private Integer memberStatus;
    @ApiModelProperty(value = "角色id")
    // 角色id
    private Integer roleId;
    @ApiModelProperty(value = "头像")
    private String picture;
    // 留言
    private String leaveWords;


    public static MemberVO ofMemberEntity(MemberEntity entity) {
        MemberVO memberVO = new MemberVO();
        BeanUtil.copyProperties(entity, memberVO);
        return memberVO;
    }
}
